﻿module Sustainalytics.Screening {

    //import Common = Sustainalytics.Common;

    export class ConfirmationController {
        public confirmResult: boolean;

        //Ctor.
        constructor(
            private $scope: ng.IScope,
            private $modalInstance: Common.IModalInstance,
            public message: string) {

            //console.log(message);
            var ctx = this;
            $scope['confirm'] = ctx;
        }

        public clickYes = function () {
            var ctx = this;
            ctx.confirmResult = true;
            ctx.$modalInstance.close({ confirmResult: ctx.confirmResult });
        };

        public closeDialog = function () {
            var ctx = this;
            ctx.confirmResult = false;
            ctx.$modalInstance.close({ confirmResult: ctx.confirmResult });
        };
    }

    angular.module(screeningToolModuleName).controller('ConfirmationController', ['$scope', '$modalInstance', 'message', ConfirmationController]);
}